<script lang="ts" setup>
import inputConfig from "@/components/Overlay/config/inputConfig";
import { getSvg } from "@/utils";
import useNavigation from "../hooks/useNavigation";
const {
  scanNum,
  closeScanRes,
  handleAddAndExit,
  handleAddAndContinue,
  scanDraw,
  scanSet,
  photoData
} = useNavigation();
</script>
<template>
  <div
    class="absolute top-0 left-0 color-#fff w-100vh h-274 rounded-[30px_30px_0px_0] bg-[#fff] origin-[left_bottom] rotate-[90deg] translate-y-[-274px] font-[Inter,Inter]"
  >
    <div class="font-bold text-26 color-[#000] text-center mt-13">
      Scan Result
    </div>
    <div class="mt-32 flex justify-start items-stretch">
      <div class="flex flex-col justify-start items-center ml-80">
        <p class="font-400 text-13 color-[#000] not-italic">Photo</p>
        <div class="w-100 aspect-ratio-[126/251]">
          <img
            v-if="photoData"
            class="w-full h-full mt-[-40px] rotate-[-90deg]"
            :src="photoData"
            alt=""
          />
        </div>
      </div>
      <div class="ml-90 color-[#414141]">
        <div class="flex justify-start items-center gap-x-22">
          <p class="font-bold text-16">Lottery Number</p>
          <van-password-input
            :value="scanNum"
            :mask="false"
            :style="inputConfig.normal.style"
            :length="6"
          />
        </div>
        <div class="font-bold flex justify-start items-center gap-x-73 mt-20">
          <div
            class="flex justify-start items-center b-b-1 b-b-solid b-b-#D0D0D0"
          >
            <span class="mr-18 text-16">Draw</span>
            <span class="color-#0C80AF text-24">{{ scanDraw }}</span>
          </div>

          <div
            class="flex justify-start items-center b-b-1 b-b-solid b-b-#D0D0D0"
          >
            <span class="mr-18 text-16">Set</span>
            <span class="color-#0C80AF text-24">{{ scanSet }}</span>
          </div>
        </div>
        <div
          class="font-[Inria_Sans,Inria_Sans] flex justify-start items-center mt-29 gap-x-8"
        >
          <div
            @click="closeScanRes"
            class="w-128 h-38 lh-38 text-center b-1 b-solid b-#004D8E rounded-6 color-#004D8E font-bold text-14"
          >
            Cancel
          </div>
          <div
            @click="handleAddAndExit"
            class="w-128 h-38 lh-38 text-center bg-[#FFD931] rounded-6 color-#004D8E font-normal text-14"
          >
            Add and Exit
          </div>
          <div
            @click="handleAddAndContinue"
            class="w-128 h-38 lh-38 text-center bg-[#004D8E] rounded-6 color-[#fff] font-normal text-14"
          >
            Add and Continue
          </div>
        </div>
      </div>
    </div>
    <div @click="closeScanRes" class="absolute top-25 right-32">
      <img class="w-17 h-17" :src="getSvg('Close(2)')" alt="" />
    </div>
  </div>
</template>
<style lang="scss" scoped>
:deep(.van-password-input) {
  .van-password-input__security {
    li {
      width: 32px;
      height: 38px;
      margin-right: 6px;
      border-radius: 4px;
      &:last-of-type {
        margin-right: 0;
      }
    }
  }
}
</style>
